import { createRouter, createWebHashHistory } from "vue-router";
import HomeView from "../views/HomeView";

const routes = [
    {
        path: "/",
        name: "home",
        component: HomeView,
        children: [
            {
                path: "",
                name: "abroad",

                component: () => import("../views/HomeView/AbroadView"),
            },
            {
                path: "img",
                name: "img",
                component: () => import("../views/HomeView/ImgView"),
            },

            {
                path: "rank",
                name: "rank",
                component: () => import("../views/HomeView/RankView"),
            },
            {
                path: "new",
                name: "new",

                component: () => import("../views/HomeView/NewView"),
            },
        ],
    },

    {
        path: "/collect",
        name: "collect",
        component: () => import("../views/CollectView/index.vue"),
    },
    {
        path: "/attention",
        name: "attention",
        component: () => import("../views/AttentionView/index.vue"),
    },
    {
        path: "/attentDetail",
        name: "attentiDetail",
        component: () => import("../views/AttentDetailView/index.vue"),
    },
    {
        path: "/newsDetail",
        name: "newsDetail",
        component: () => import("../views/NewsDetailView/index.vue"),
    },
    {
        path: "/login",
        name: "login",
        component: () => import("../views/LoginView/index.vue"),
    },
    {
        path: "/register",
        name: "register",
        component: () => import("../views/RegisterView/index.vue"),
    },
    {
        path: "/my",
        name: "my",
        component: () => import("../views/MyView/index.vue"),
    },
    {
        path: "/search",
        name: "search",
        component: () => import("../views/SearchView/index.vue"),
    },
    {
        path: "/imgDetail",
        name: "imgDetail",
        component: () => import("../views/ImgDetailView/index.vue"),
    },
    {
        path: "/record",
        name: "record",
        component: () => import("../views/RecordView/index.vue"),
    },
    {
        path: "/edit",
        name: "edit",
        component: () => import("../views/EditView/index.vue"),
    },
];

const router = createRouter({
    history: createWebHashHistory(),
    routes,
});

export default router;
